class ErrorCode:
    success = 200
    FailQueryEmployee = 20000001
    EmployeeAlreadyExists = 20000002
    FailQueryDepartment = 10000001
    DepartmentAlreadyExists = 10000002
    FailCreateBug = 30000001
    FailCreateBugByBugName = 30000002

    Error_Message = {
        success: "成功",
        FailQueryEmployee: "查询员工信息失败",
        EmployeeAlreadyExists: "员工已存在",
        FailQueryDepartment: "查询部门信息失败",
        DepartmentAlreadyExists: "部门已存在",
        FailCreateBug: "创建缺陷失败,请查看你的创建者或指派者是否存在",
        FailCreateBugByBugName: "缺陷名称格式不正确"
    }

    @classmethod
    def get_error_message(cls, code):
        return cls.Error_Message.get(code, '未知错误')
